package com.example.administrator.kotlindemo

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.TextView

/**
 * Created by Administrator on 2017/8/1.
 */

class SecondActivity : Activity(), View.OnClickListener {
    private var text_return: TextView? = null
    private var text_three_jump: TextView? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second)
        text_return = findViewById<TextView>(R.id.text_return)
        text_return!!.setOnClickListener(this)
        text_three_jump = findViewById(R.id.text_three_jump)
        text_three_jump!!.setOnClickListener(this)
    }


    override fun onClick(view: View) {
        when (view.id) {
            R.id.text_return -> finish()
            R.id.text_three_jump -> startActivity(Intent(SecondActivity@ this,ThirdActivity::class.java))
        }
    }
}
